package com.hs.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 权限
 * </p>
 *
 * @author hs
 * @since 2019-04-29
 */
@ApiModel(value="SysPerm对象", description="权限")
public class SysPerm extends Model<SysPerm> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "权限值，shiro的权限控制表达式")
    @TableId(value = "pval", type = IdType.INPUT)
    private String pval;

    @ApiModelProperty(value = "父权限id")
    private String parent;

    @ApiModelProperty(value = "权限名称")
    private String pname;

    @ApiModelProperty(value = "权限类型：1.菜单 2.按钮 3.接口 4.特殊")
    private Integer ptype;

    @ApiModelProperty(value = "是否叶子节点")
    private Boolean leaf;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime created;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updated;

    public String getPval() {
        return pval;
    }

    public void setPval(String pval) {
        this.pval = pval;
    }
    public String getParent() {
        return parent;
    }

    public void setParent(String parent) {
        this.parent = parent;
    }
    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }
    public Integer getPtype() {
        return ptype;
    }

    public void setPtype(Integer ptype) {
        this.ptype = ptype;
    }
    public Boolean getLeaf() {
        return leaf;
    }

    public void setLeaf(Boolean leaf) {
        this.leaf = leaf;
    }
    public LocalDateTime getCreated() {
        return created;
    }

    public void setCreated(LocalDateTime created) {
        this.created = created;
    }
    public LocalDateTime getUpdated() {
        return updated;
    }

    public void setUpdated(LocalDateTime updated) {
        this.updated = updated;
    }

    @Override
    protected Serializable pkVal() {
        return this.pval;
    }

    @Override
    public String toString() {
        return "SysPerm{" +
        "pval=" + pval +
        ", parent=" + parent +
        ", pname=" + pname +
        ", ptype=" + ptype +
        ", leaf=" + leaf +
        ", created=" + created +
        ", updated=" + updated +
        "}";
    }
}
